<?php
/**
 * Created by PhpStorm.
 * User: lili
 * Date: 2018/12/3
 * Time: 12:23
 */

namespace app\admin\controller;


use think\Config;

class Wechat extends Common
{

    protected $beforeActionList = [
        'seven'  ,


    ];

    protected function seven()
    {
        $this->assign('t',7);

    }
    
    /*
     * 微信设置
     * @param [string] appid
     * @param [string] appsecret
     * */
    public function index(){
        $coffile = CONF_PATH.DS.'extra'.DS.'sys.php';
        if(request()->isPost()){
            Config::load($coffile, '', 'sys');
            $conflist = Config::get('','sys');
            $param = input('post.','','htmlspecialchars,strip_tags,trim');
            $param = add_slashes_recursive($param);
            setConfigfile($coffile, array_merge($conflist, $param));
            $this->success('更新设置成功');
        }
        return $this->fetch();
    }
    
    
}